package com.ruoyi.guarantee.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.guarantee.domain.FzGuarantee;
import com.ruoyi.guarantee.mapper.FzGuaranteeMapper;
import com.ruoyi.guarantee.service.IFzGuaranteeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 保修管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-03-13
 */
@Service
public class FzGuaranteeServiceImpl implements IFzGuaranteeService
{
    @Autowired
    private FzGuaranteeMapper fzGuaranteeMapper;

    /**
     * 查询保修管理
     * 
     * @param guaranteeId 保修管理ID
     * @return 保修管理
     */
    @Override
    public FzGuarantee selectFzGuaranteeById(String guaranteeId)
    {
        return fzGuaranteeMapper.selectFzGuaranteeById(guaranteeId);
    }

    /**
     * 查询保修管理列表
     * 
     * @param fzGuarantee 保修管理
     * @return 保修管理
     */
    @Override
    public List<FzGuarantee> selectFzGuaranteeList(FzGuarantee fzGuarantee)
    {
        return fzGuaranteeMapper.selectFzGuaranteeList(fzGuarantee);
    }

    /**
     * 新增保修管理
     * 
     * @param fzGuarantee 保修管理
     * @return 结果
     */
    @Override
    public int insertFzGuarantee(FzGuarantee fzGuarantee)
    {
        fzGuarantee.setCreateTime(DateUtils.getNowDate());
        return fzGuaranteeMapper.insertFzGuarantee(fzGuarantee);
    }

    /**
     * 修改保修管理
     * 
     * @param fzGuarantee 保修管理
     * @return 结果
     */
    @Override
    public int updateFzGuarantee(FzGuarantee fzGuarantee)
    {
        fzGuarantee.setUpdateTime(DateUtils.getNowDate());
        return fzGuaranteeMapper.updateFzGuarantee(fzGuarantee);
    }

    /**
     * 删除保修管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFzGuaranteeByIds(String ids)
    {
        return fzGuaranteeMapper.deleteFzGuaranteeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除保修管理信息
     * 
     * @param guaranteeId 保修管理ID
     * @return 结果
     */
    @Override
    public int deleteFzGuaranteeById(String guaranteeId)
    {
        return fzGuaranteeMapper.deleteFzGuaranteeById(guaranteeId);
    }
}
